{% extends 'BWLwebshopBundle::layout.html.twig' %}

{% block title %}Warenkorb{% endblock %}

{% block body %}
    <link href="{{ asset('css/items.css') }}" type="text/css"
          rel="stylesheet"/>
    <h1>Warenkorb</h1>
    {% if not is_granted('IS_AUTHENTICATED_FULLY') %}
        <p>please login before use</p>
    {% else %}
        {% for item in items %}
            <a href="/showSpecificItem/{{ item.0.id }}">
                <ul class="itemList">
                    <li><img
                            src=../pictures/{{ item.0.image }} alt="{{ item.0.name }}
                        image not found"
                        class="small" />
                    </li>
                    <li>{{ item.0.name }}</li>
                    <li>{{ item.0.salePrice }} €</li>
                    <li>Anzahl :{{ item.1 }}</li>
                    <li>
                        <a href="{{ path('bwl_webshop_removeFromCart',{'id':item.0.id}) }}"><img
                                src=../icon/removeFromCart.jpg
                                alt="aus dem Warenkorb entfernen"
                                class="small"/></a></li>
                    <hr>
                </ul>
            </a>
        {% endfor %}
        <p>Gesamtpreis: {{ totalPrice }} €</p>
        {% if items != null %}
            <a href="{{ path('bwl_webshop_orderNow') }}"><img src=../icon/orderNow.jpg alt="Jetzt bestellen" class="small"/></a>
        {% endif %}


    {% endif %}
{% endblock %}